pub fn verse(n: u32) -> String {
    match n {
        0 => "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n".to_string(),
        1 => "1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n".to_string(),
        2.. => {
            let x = n - 1;
            if x == 1 {
                format!("{n} bottles of beer on the wall, {n} bottles of beer.\nTake one down and pass it around, {x} bottle of beer on the wall.\n")
            } else {
                format!("{n} bottles of beer on the wall, {n} bottles of beer.\nTake one down and pass it around, {x} bottles of beer on the wall.\n")
            }
        }
    }
}

pub fn sing(start: u32, end: u32) -> String {
    (end..=start)
        .rev()
        .collect::<Vec<u32>>()
        .into_iter()
        .map(verse)
        .collect::<Vec<String>>()
        .join("\n")
}


#[test]
#[ignore]
fn song_8_6() {
    assert_eq!(sing(8, 6), "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n");
}
